package com.financing.platform.dao.impl;


import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IWxUserRewardLogDao;
import com.financing.platform.dto.WxUserRewardLogDTO;
import com.financing.platform.util.SqlName;
import com.financing.platform.util.SqlName.WxUserRewardLogSql;
/**
 * wx_user_reward_log  
 * 用户奖励流水 数据访问层实现类
 * @author lisu
 *
 */
 
@Repository("wxUserRewardLogDao")
public class WxUserRewardLogDaoImpl extends BaseDaoImpl implements IWxUserRewardLogDao {


	@Override
	public int insert(WxUserRewardLogDTO wxUserRewardLog) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.WxUserRewardLogSql.insert, wxUserRewardLog);
	}

	@Override
	public void update(WxUserRewardLogDTO wxUserRewardLog) throws SQLException {
		this.sqlMapClient.update(SqlName.WxUserRewardLogSql.update, wxUserRewardLog);
	}

	@Override
	public void updateForce(WxUserRewardLogDTO wxUserRewardLog) throws SQLException {
		this.sqlMapClient.update(SqlName.WxUserRewardLogSql.updateForce, wxUserRewardLog);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.WxUserRewardLogSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<WxUserRewardLogDTO> queryList(WxUserRewardLogDTO wxUserRewardLog) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.WxUserRewardLogSql.queryList, wxUserRewardLog);
	}

	@Override
	public int queryListCount(WxUserRewardLogDTO wxUserRewardLog) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.WxUserRewardLogSql.queryListCount, wxUserRewardLog);
	}

	@Override
	public WxUserRewardLogDTO loadById(Integer id) throws SQLException {
		return  (WxUserRewardLogDTO)this.sqlMapClient.queryForObject(SqlName.WxUserRewardLogSql.loadById,id);
	}

	@Override
	public BigDecimal loadAllMoneyById(WxUserRewardLogDTO wxUserRewardLog)
			throws SQLException {
		return (BigDecimal) this.sqlMapClient.queryForObject(WxUserRewardLogSql.loadAllMoneyById,wxUserRewardLog);
	}

	@Override
	public BigDecimal loadRewardMoney(WxUserRewardLogDTO wxUserRewardLog)
			throws SQLException {
		return (BigDecimal) this.sqlMapClient.queryForObject(WxUserRewardLogSql.loadRewardMoney,wxUserRewardLog);
	}

	@Override
	public BigDecimal queryEarlyWarningMoney(Map<String, Object> paraMap)
			throws SQLException {
		return (BigDecimal) this.sqlMapClient.queryForObject(WxUserRewardLogSql.queryEarlyWarningMoney,paraMap);
	}
 	
}
